x = as.data.frame(Titanic)
freq_column_name = "Freq"

idx = rep.int(seq_len(nrow(x)), x[[freq_column_name]])
x[[freq_column_name]] = NULL
data_titanic = x[idx,]
